﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

namespace Ue.Extensions
{
    public static class AssemblyExtensions
    {
        /// <summary>
        /// 取得资源文件的完整名称：命名空间+文件名
        /// </summary>
        /// <param name="assembly"></param>
        /// <param name="resourceFileName">资源文件名</param>
        /// <returns></returns>
        public static string GetManifestResourceFullName(this Assembly assembly, string resourceFileName)
        {
            return assembly.GetManifestResourceNames().FirstOrDefault(fullName => fullName.EndsWith(resourceFileName));
        }
    }
}
